﻿<?php
require_once('header.php');
include("adodb5/adodb-exceptions.inc.php");
include('adodb5/adodb.inc.php');

$strDsn = 'mssql://influenza:inf123456@10.1.251.14';
$strHtmlOutput = '';

$intAgrega = $_REQUEST['intAgrega'];

$cnn = ADONewConnection($strDsn);
$cnn->SetFetchMode(ADODB_FETCH_ASSOC);


/*$strHtmlOutput	=	'<!--<select name="cboSector" id="cboSector" onfocus="javascript: $(\'divUserAddMsg\').update(\'Seleccione un sector.\');" onblur="javascript: $(\'divUserAddMsg\').update(\'\');">
						<option value="1" selected="selected">1.-&nbsp;ISSSTE</option>
						<option value="2" >2.-&nbsp;IMSS</option>
						<option value="3" >3.-&nbsp;Unidades&nbsp;de&nbsp;Salud</option>
					</select>-->*/
$intSector = $_REQUEST['intSector'];
$intIndicador = $_REQUEST['intIndicador'];
$intAgrega = $_REQUEST['intAgrega'];
$cadena = "";

if ($intIndicador == 1)
	{	$cmbo = 'cboDelegacion';	}
else
	{	$cmbo = 'cboEntidades';	
		$intSector = 3;
	}
if ($intAgrega == 1)
	{	$cadena = ", intAgrega: 1";	}

if ($intSector == "")
    {   $intSector = 3; }  

$strSql = "select id_Institucion, str_Institucion from influenza..cat_Instituciones";
$rs = $cnn->Execute($strSql);

echo "<label class=Texto_gral>Seleccione una Institución: </label>";
echo "<select name=cboSector id=cboSector style=width:250px onchange=\"javascript: updateControl('divUsmiNameList', 'cboUsmiNameFill.php', {intEntidad: $('$cmbo').options[$('$cmbo').selectedIndex].value, intSector: $('cboSector').options[$('cboSector').selectedIndex].value $cadena});\">";
while(!$rs->EOF)
    {       $selected = "";
            $rs->FetchInto($arrCurrentRow);
            $strIdInstitucion = $arrCurrentRow['id_Institucion'];
            $strInstitucion = htmlentities($arrCurrentRow['str_Institucion']);

            if ($intSector == $strIdInstitucion)
                {   $selected = "selected =\"selected\"";    }

            echo	"<option value=\"$strIdInstitucion\" $selected>$strIdInstitucion.- $strInstitucion</option>\n";
    }
echo "</select>";
?>
<!--<label class=Texto_gral>Seleccione un sector: </label>
<select name="cboSector" id="cboSector" style="width:250px" onchange="javascript: updateControl('divUsmiNameList', 'cboUsmiNameFill.php', {intEntidad: $('<?php echo $cmbo;?>').options[$('<?php echo $cmbo;?>').selectedIndex].value, intSector: $('cboSector').options[$('cboSector').selectedIndex].value <?php echo $cadena; ?>});">
    <option value="1" <?php if ($intSector == 1) { echo "selected =\"selected\"";} ?>>1.-&nbsp;ISSSTE</option>
    <option value="2" <?php if ($intSector == 2) { echo "selected =\"selected\"";} ?>>2.-&nbsp;IMSS</option>
    <option value="3" <?php if ($intSector == 3) { echo "selected =\"selected\"";} ?>>3.-&nbsp;Unidades&nbsp;de&nbsp;Salud</option>
</select>-->

